#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>

using namespace std;

int temperatureTrend(vector<int>& temperatureA, vector<int>& temperatureB) {
    auto getTrend = [](int x, int y) -> int {
        if (x == y)  return 0;
        return x < y ? -1 : 1;
    };

    int n = temperatureA.size();
    int ans = 0, cur = 0;
    for (int i = 1; i < n; i++)
    {
        int ta = getTrend(temperatureA[i - 1], temperatureA[i]);
        int tb = getTrend(temperatureB[i - 1], temperatureB[i]);
        if (ta == tb)
        {
            cur++;
            ans = max(ans, cur);
        }
        else    cur = 0;
    }
    return ans;
}